<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich" >
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
    </h:head>
    <h:body>
        <rich:panel header="支付文件列表" styleClass="content-hight" >
            <h:form id ="emp">
                <h:commandButton value="查看" action="#{payfile.selectPayFile}"/>
                <h:commandButton value="导出Excel" action="#{payfile.exportExcel}"/>
                <h:commandButton value="返回" action="#{payfile.goback}"/>

                <rich:dataTable id="editTable" rows="10"
                                style="width:100%;"
                                noDataLabel="无数据"
                                value="#{payfile.model}" var="pflistfc">

                    <rich:column sortBy="#{pflistfc.vounumber}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="支付文件号"/>
                            </h:panelGroup>
                        </f:facet>
                        <a4j:commandLink value="#{pflistfc.vounumber}" oncomplete="#{rich:component('panel')}.show()" action="#{payfile.showFilesDetail}" render="panel"/>
                    </rich:column>

                    <rich:column sortBy="#{pflistfc.pdate}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="支付文件日期"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pflistfc.pdate}">
                            <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{pflistfc.checknum}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="支票号"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pflistfc.checknum}"/>
                    </rich:column>

                    <rich:column sortBy="#{pflistfc.amount}">
                        <f:facet name="header"  >
                            <h:panelGroup>
                                <h:outputText value="总金额"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pflistfc.amount}" >
                            <f:convertNumber type="number" pattern="#,##0.00"/>
                        </h:outputText>
                    </rich:column>

                    <rich:column sortBy="#{pflistfc.casher}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="出纳"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pflistfc.casher}"/>
                    </rich:column>

                    <rich:column sortBy="#{pflistfc.memo}">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="备注"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pflistfc.memo}"/>
                    </rich:column>

                    <rich:column >
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="操作"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:commandLink action="#{payfile.expPsnPayFile}">
                            <h:outputText value="输出"/>
                        </h:commandLink>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:dataScroller id="ds"></rich:dataScroller>
                    </f:facet>
                </rich:dataTable>
            </h:form>
        </rich:panel>

        <rich:popupPanel id="panel" autosized="true">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="明细信息"></h:outputText>
                </h:panelGroup>
            </f:facet>

            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('panel')}.hide()">关闭</h:outputLink>
            </f:facet>


            <rich:panel>

                <h:panelGroup>
                    <div style="height:320px;overflow:auto;">

                        <rich:dataTable id ="interfaceli" value ="#{payfile.fileDetailModel}" var ="detail"
                                        onrowmouseover="this.style.backgroundColor='#F1F1F1'"
                                        onrowmouseout="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                                        rowClasses="list-row-odd,list-row-even">


                            <rich:column>
                                <f:facet name ="header">
                                    <h:outputText value ="支付文件号"/>
                                </f:facet>
                                <h:outputText value="#{detail.vounumber}"/>
                            </rich:column>

                            <rich:column>
                                <f:facet name="header">
                                    <h:outputText value="支付文件日期"/>
                                </f:facet>
                                <h:outputText value="#{detail.pdate}">
                                    <f:convertDateTime pattern="yyyy年MM月dd日" timeZone="GMT+8" locale="cn" />
                                </h:outputText>
                            </rich:column>

                            <rich:column>
                                <f:facet name="header">
                                    <h:outputText value="支付人员姓名"/>
                                </f:facet>
                                <h:outputText value="#{detail.name}"/>
                            </rich:column>
                            <rich:column>
                                <f:facet name="header">
                                    <h:outputText value="帐号"/>
                                </f:facet>
                                <h:outputText value="#{detail.account}"/>
                            </rich:column>

                            <rich:column>
                                <f:facet name="header">
                                    <h:outputText value="支付金额"/>
                                </f:facet>
                                <h:outputText value="#{detail.payamount}"/>
                            </rich:column>
                        </rich:dataTable>

                    </div>
                </h:panelGroup>
            </rich:panel>

            <f:facet name="footer">
                <rich:dataScroller id="ds"></rich:dataScroller>
            </f:facet>
        </rich:popupPanel>



    </h:body>
</html>
